package net.esj.basic.dao.ann.criterion;

import net.esj.basic.dao.ann.component.table.AbstractTable;

public class TableCriterion extends PropertyCriterion<AbstractTable> implements AliasCriterion{

	protected int position = 0;

	public TableCriterion(AbstractTable table, int position) {
		super(table);
		this.position = position;
	}

	public TableCriterion(AbstractTable table) {
		super(table);
	}
	
	@Override
	public String toSql() {
		return value.getTableName();
	}

	@Override
	public String getAlias() {
		return value.getTableName()+"_"+position;
	}
}
